package cn.ywsj.ywsjmidtier.controller;

import cn.ywsj.ywsjmidtier.entity.VO.FeedbackVo;
import cn.ywsj.ywsjmidtier.service.WechatFeedbackFeign;
import cn.ywsj.ywsjmidtier.utils.JsonObjectUtil;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "反馈")
@RestController
@RequestMapping("/wechat/member/feedbackmgr")
public class WechatFeedbackController {
  @Autowired
    private WechatFeedbackFeign wechatFeedbackFeign;

    /**
     * 反馈信息
     * @param feedbackVo
     * @return
     */
  @ApiOperation("反馈信息")
  @PostMapping("/addfeedback")
  public String addFeedback(FeedbackVo feedbackVo){
    /* MultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
     map.add("feedbackInformation",feedbackVo.getFeedbackInformation());
     map.add("contactInfo",feedbackVo.getContactInfo());
     map.add("type",feedbackVo.getType());*/
      JSONObject jsonObject = JsonObjectUtil.ObjectToJson(feedbackVo);
      return wechatFeedbackFeign.addFeedback(jsonObject);
  }
}
